// SupportHangerSubObject.cpp: implementation of the SupportHangerSubObject class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "phsshare.h"
#include "SupportHangerSubObject.h"
#include "Part.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

UE_IMPLEMENT_DYNAMIC(SupportHangerSubObject, ModelObject);
SupportHangerSubObject::SupportHangerSubObject()
{
	m_pSH = NULL;
}

SupportHangerSubObject::~SupportHangerSubObject()
{
	
}

void SupportHangerSubObject::SupportHangerOwner(SupportHanger* pSH)
{
	ASSERT(pSH);
	ASSERT(!m_pSH || m_pSH == pSH);
	m_pSH = pSH; 

	PropertySystem::PropertyStack::Iterator* pIt = this->GetPropertyStack()->NewPartTypeIterator();
	for(pIt->Begin(); !pIt->End(); pIt->Next())
	{
		Variable* pVar = pIt->Get();
		ASSERT(pVar);
		
		Part* pPart = (Part*)(*pVar);
		pPart->SupportHangerOwner(pSH);
	}
	delete pIt;
}
